-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add DOTNET_DbgCreateDumpToolPath to override createdump directory (NativeAOT only) #122989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: steveisok <[email protected]>
Co-authored-by: steveisok <[email protected]>
Co-authored-by: steveisok <[email protected]>
|
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
…dbgcreatdumptoolpath
… validation - Changed DbgCreateDumpToolPath to accept a directory path instead of full executable path - The runtime now concatenates the directory with "createdump" like the default behavior - Removed stat() validation as it was removed in commit c507305 - Updated documentation to clarify this is NativeAOT only and the variable accepts a directory path - Updated usage example to reflect the directory path usage Co-authored-by: steveisok <[email protected]>
- Initialize buffer with '\0' before using strncat - Use proper buffer size calculations in strncat calls to prevent buffer overruns - Ensures safe string concatenation following C string best practices Co-authored-by: steveisok <[email protected]>
- Calculate exact buffer size based on whether slash is needed - Follow same pattern as default code path using strncpy and strncat - More readable and maintainable code structure Co-authored-by: steveisok <[email protected]>
Changed "ignored in CoreCLR" to "ignored otherwise" since NativeAOT uses a stripped-down version of CoreCLR, making the original wording ambiguous. Co-authored-by: steveisok <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds a new environment variable DOTNET_DbgCreateDumpToolPath to allow NativeAOT applications to specify a custom directory where the createdump tool is located. This addresses scenarios where createdump is not shipped with the NativeAOT runtime, enabling users to provide their own dump generation tool.
Changes:
- Modified
PalCreateDumpInitialize()to check forDOTNET_DbgCreateDumpToolPathenvironment variable and use it to locate createdump - Added if/else logic to support both custom path and default library-based path discovery
- Updated documentation to describe the new environment variable and its NativeAOT-only support
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/nativeaot/Runtime/unix/PalCreateDump.cpp | Adds environment variable check and custom path handling for createdump tool location with proper memory management and path concatenation logic |
| docs/design/coreclr/botr/xplat-minidump-generation.md | Documents the new DOTNET_DbgCreateDumpToolPath environment variable with usage examples and NativeAOT-only clarification |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
… conditions (#123074) Fixes potential crashes or hangs during process shutdown due to race conditions in vector destructor execution. Noticed while reviewing #122989 --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: Jan Kotas <[email protected]> Co-authored-by: Copilot <[email protected]>
Documents new environment variable added in dotnet/runtime#122989 where you can point to an alternate directory where the createdump tool lives. Works only with NativeAOT .NET 11 and above.
* Add DOTNET_DbgCreateDumpToolPath env variable and description Documents new environment variable added in dotnet/runtime#122989 where you can point to an alternate directory where the createdump tool lives. Works only with NativeAOT .NET 11 and above. * Update docs/core/diagnostics/collect-dumps-crash.md Co-authored-by: Genevieve Warren <[email protected]> --------- Co-authored-by: Genevieve Warren <[email protected]>
Description
Adds
DOTNET_DbgCreateDumpToolPathenvironment variable to allow specifying a directory path where the createdump tool is located. In scenarios where createdump is not shipped with the NativeAOT runtime, users can now provide their own dump generation tool.Note: This environment variable is only supported in NativeAOT applications and is ignored otherwise (not in other runtime configurations).
Implementation
PalCreateDumpInitialize()to checkDOTNET_DbgCreateDumpToolPathfor a directory pathRhConfig::Environment::TryGetStringValue()Usage
The runtime will look for
/path/to/directory/createdumpCustomer Impact
Customers deploying NativeAOT in environments without createdump (custom distributions, minimal containers, embedded systems) currently cannot generate crash dumps. This prevents critical debugging in production scenarios.
Regression
No. This is a new opt-in feature with no impact on existing behavior. Only affects NativeAOT applications.
Testing
Risk
Low. New environment variable only used when explicitly set. Code path follows existing directory concatenation pattern used for default createdump lookup. No changes to existing dump generation logic. NativeAOT only, so no impact on other runtime configurations.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.